package com.yiyahui.project.erp.service.impl;

import java.util.List;
import com.yiyahui.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yiyahui.project.erp.mapper.YiyaChargeProjectMapper;
import com.yiyahui.project.erp.domain.YiyaChargeProject;
import com.yiyahui.project.erp.service.IYiyaChargeProjectService;

/**
 * 收费项目Service业务层处理
 * 
 * @author yiyahui
 * @date 2020-05-12
 */
@Service
public class YiyaChargeProjectServiceImpl implements IYiyaChargeProjectService 
{
    @Autowired
    private YiyaChargeProjectMapper yiyaChargeProjectMapper;

    /**
     * 查询收费项目
     * 
     * @param id 收费项目ID
     * @return 收费项目
     */
    @Override
    public YiyaChargeProject selectYiyaChargeProjectById(Long id)
    {
        return yiyaChargeProjectMapper.selectYiyaChargeProjectById(id);
    }

    /**
     * 查询收费项目列表
     * 
     * @param yiyaChargeProject 收费项目
     * @return 收费项目
     */
    @Override
    public List<YiyaChargeProject> selectYiyaChargeProjectList(YiyaChargeProject yiyaChargeProject)
    {
        return yiyaChargeProjectMapper.selectYiyaChargeProjectList(yiyaChargeProject);
    }

    /**
     * 新增收费项目
     * 
     * @param yiyaChargeProject 收费项目
     * @return 结果
     */
    @Override
    public int insertYiyaChargeProject(YiyaChargeProject yiyaChargeProject)
    {
        yiyaChargeProject.setCreateTime(DateUtils.getNowDate());
        return yiyaChargeProjectMapper.insertYiyaChargeProject(yiyaChargeProject);
    }

    /**
     * 修改收费项目
     * 
     * @param yiyaChargeProject 收费项目
     * @return 结果
     */
    @Override
    public int updateYiyaChargeProject(YiyaChargeProject yiyaChargeProject)
    {
        yiyaChargeProject.setUpdateTime(DateUtils.getNowDate());
        return yiyaChargeProjectMapper.updateYiyaChargeProject(yiyaChargeProject);
    }

    /**
     * 批量删除收费项目
     * 
     * @param ids 需要删除的收费项目ID
     * @return 结果
     */
    @Override
    public int deleteYiyaChargeProjectByIds(Long[] ids)
    {
        return yiyaChargeProjectMapper.deleteYiyaChargeProjectByIds(ids);
    }

    /**
     * 删除收费项目信息
     * 
     * @param id 收费项目ID
     * @return 结果
     */
    @Override
    public int deleteYiyaChargeProjectById(Long id)
    {
        return yiyaChargeProjectMapper.deleteYiyaChargeProjectById(id);
    }

    @Override
    public List<YiyaChargeProject> selectByIds(List<Long> ids) {
        return yiyaChargeProjectMapper.selectByIds(ids);
    }
}
